class Solution0805 {
    public int multiply(int A, int B) {
          int b = A>B?A:B ; 
          int a = A>B?B:A ; 
          return getNum( a ,  b); 
    }
    private int getNum(int a , int b ) {
          if(a == 0 || b == 0) return 0 ; 
          int mid  = getNum(a , b/2) ; 
          if(b %2 == 0){
            return mid+mid ;
          }
          return mid+mid+a; 
    } 
   
}